package com.fang.algorithm.zuo.array;

/**
 * @author lingxiao.fang
 * @Desc 求数组arr中L-R的最大值
 * @createTime 2025/2/9 18:44
 */
public class Test06_ArrayLRMax {
    public static int process(int[] arr, int L, int R) {
        if (L == R) {
            return arr[L];
        }
        int mid = L + R / 2;
        int leftMax = process(arr, L, mid);
        int rightMax = process(arr, mid + 1, R);
        return Math.max(leftMax, rightMax);
    }
}
